package com.neu.cloudfactory.repository;

import com.neu.cloudfactory.bean.Equipement.Equipment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface EquipmentRepository extends JpaRepository<Equipment,Integer> {
    void deleteAllByFactoryid(int factoryid);
    Page<Equipment> findAllByIdOrNameContainingOrDescriptionContainingOrFactoryid(Integer id,String input1,String input2,Integer factroyid, Pageable pageable);
    Page<Equipment> findAllByFactoryid(Integer factoryid,Pageable pageable );
    Page<Equipment> findAllByFactoryidAndBorrowable(Integer factoryid,boolean borrowable,Pageable pageable);
    boolean existsByTypeid(Integer typeid);
    List<Equipment> findAllByTypeid(Integer typeid);
}
